using System;
using System.Windows;

namespace ChessKit.Common
{
  public class DelegateColorizer<T> : Colorizer<T>
  {
    public Func<BoardLocation, T> Tester { get; private set; }

    public DelegateColorizer(DependencyProperty property, Func<BoardLocation, T> tester) 
      : base(property)
    {
      Tester = tester;
    }

    protected override T TestCore(BoardLocation location)
    {
      return Tester(location);
    }
  }
}